export default function FormatNumber(num: string | number)
{
    num = String(Number(num).toFixed(2));

    const numbers = num.split(".");

    const integerArr = numbers[0].split('');

    const decimal = Number(numbers[1]) === 0 ? '.00' : `.${numbers[1]}`;

    const integer = integerArr.reverse().reduce((prve: string, curr: string, index: number) =>
    {
        let str = prve;

        if (index % 3 === 0 && index !== 0)
        {
            str += ',';
        }
        return str + curr;
    }, '').split('').reverse().join('');

    return integer + decimal;
};
